<!DOCTYPE html>
<html lang="en">
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('用户列表')" />
</head>
<body class="gray_bg">
    <div class="container-div">
        <div class="btn-group-sm" id="toolbar">
            <a class="btn btn-success" onclick="$.operate.add()" >
                <i class="fa fa-plus"></i> 新增
            </a>
        </div>
        <div class="row">
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>

</body>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
   
    var prefix = ctx + "book/user";
    $(function(){

            var options = {
                modalName:"用户",

                url:prefix +"/list",
                createUrl:prefix+"/add",
                updateUrl:prefix+"/update/{id}",
                removeUrl:prefix+"/remove/{id}",
                uniqueId:"id",
                columns:[
                {
                        field:"id",
                        title:"id"
                    },
                    {
                        field:"email",
                        title:"邮箱"
                    },
                    {
                        field:"nickname",
                        title:"昵称"
                    },
                    {
                        field:"sex",
                        title:"性别"
                    },
                    {
                        field:"openid",
                        title:"openid"
                    },
                    {
                        field:"coin",
                        title:"金币"
                    },
                    {
		            title: '操作',
		            align: 'center',
		          formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs '  + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' +  '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
		        }
                ]

            };
            $.table.init(options);

    });

</script>
</html>